
/* data Figure 1 and tests */
proc freq data=actoren;
 tables (grouptype ECdummy EUlevelPolitical)*DVdummy/chisq norow nopercent nocum;
run;

/* Table 1 */
proc freq data=actoren; tables DVdummy*AgencyGroup*grouptype/nocol nopercent chisq; 
run;

/* models, as they appear in the discussion */ 
/* without control variables */
/* null model */
proc glimmix data=actoren method=laplace empirical noclprint;
  class DVdummy(ref="0") grouptype(ref="RegBusiness") ECdummy(ref="0") EUlevelPolitical(ref="0") AgencyGroup; 
  model DVdummy =/cl dist=binary link=logit oddsratio(diff=last) solution chisq;
  covtest/wald;
proc glimmix data=actoren method=laplace empirical noclprint;
  class DVdummy(ref="0") grouptype(ref="RegBusiness") ECdummy(ref="0") EUlevelPolitical(ref="0") AgencyGroup; 
  model DVdummy =/cl dist=binary link=logit oddsratio(diff=last) solution chisq;
  random intercept /subject=AgencyGroup s cl type=vc;
  covtest/wald;
run;

/* with control variables, table A2 */
proc glimmix data=actoren method=laplace empirical noclprint;
  class DVdummy(ref="0") grouptype(ref="RegBusiness") ECdummy(ref="0") EUlevelPolitical(ref="0") AgencyGroup; 
  model DVdummy = grouptype ECdummy EUlevelPolitical StaffZ LnAge/dist=binary link=logit oddsratio(diff=last) solution chisq;
  random intercept /subject=AgencyGroup s cl type=vc;
  output out=paccess pred=xbeta pred(ilink)=predprob stderr(ilink) ucl lcl; 
  covtest/wald;
proc glimmix data=paccess method=laplace empirical noclprint;
  class DVdummy(ref="0") grouptype(ref="RegBusiness") ECdummy(ref="0") EUlevelPolitical(ref="0") AgencyGroup; 
  model DVdummy = grouptype ECdummy EUlevelPolitical             /dist=binary link=logit oddsratio(diff=last) solution chisq;
  random intercept /subject=AgencyGroup s cl type=vc;
  covtest/wald;
  where predprob ne .;
run;

/* Table 2*/
/* model I */
proc glimmix data=actoren method=laplace empirical noclprint;
  class DVdummy(ref="0") grouptype(ref="RegBusiness") ECdummy(ref="0") EUlevelPolitical(ref="0") AgencyGroup; 
  model DVdummy = grouptype ECdummy EUlevelPolitical grouptype/dist=binary link=logit oddsratio(diff=last) solution chisq;
  random intercept /subject=AgencyGroup s cl type=vc;
  covtest/wald;
  output out=paccess pred=xbeta pred(ilink)=predprob stderr(ilink) ucl lcl; 
/* model II */
proc glimmix data=actoren method=laplace empirical noclprint;
  class DVdummy(ref="0") grouptype(ref="RegBusiness") ECdummy(ref="0") EUlevelPolitical(ref="0") AgencyGroup; 
  model DVdummy = grouptype ECdummy EUlevelPolitical          /dist=binary link=logit oddsratio(diff=last) solution chisq;
  random intercept /subject=AgencyGroup s cl type=vc;
  covtest/wald;
  output out=l0access pred=xbeta pred(ilink)=predprob stderr(ilink) ucl lcl; 
  where legalyes=0;
/* model III */
proc glimmix data=actoren method=laplace empirical noclprint;
  class DVdummy(ref="0") grouptype(ref="RegBusiness") ECdummy(ref="0") EUlevelPolitical(ref="0") AgencyGroup; 
  model DVdummy = grouptype ECdummy EUlevelPolitical/dist=binary link=logit oddsratio(diff=last) solution chisq;
  random intercept /subject=AgencyGroup s cl type=vc;
  covtest/wald;
  output out=l1access pred=xbeta pred(ilink)=predprob stderr(ilink) ucl lcl; 
  where legalyes=1;
/* model IV, with interaction effect */
proc glimmix data=actoren method=laplace empirical noclprint;
  class DVdummy(ref="0") grouptype(ref="RegBusiness") ECdummy(ref="0") EUlevelPolitical(ref="0") AgencyGroup; 
  model DVdummy = grouptype ECdummy EUlevelPolitical grouptype*ECdummy/dist=binary link=logit oddsratio(diff=last) solution chisq;
  random intercept /subject=AgencyGroup s cl type=vc;
  covtest/wald;
run;

/* data Figure 2 */
proc means data=paccess mean std maxdec=2; var predprob StdErrMU; class grouptype;
proc means data=paccess mean std maxdec=2; var predprob StdErrMU; class ECdummy;
proc means data=paccess mean std maxdec=2; var predprob StdErrMU; class EUlevelPolitical;
run;




